﻿CREATE PROCEDURE [dbo].[GetMediaDefinitionsByManCoDoc] 
	@ManCoDocID int
AS
BEGIN

	SELECT MediaDefID
		  ,QueueName
		  ,QueueNameSymbollic
		  ,m.ManCoDocID
		  ,m.IndexDefinitionID
		  ,QueueDescription
		  ,Hold
		  ,BatchSizeSheets
		  ,FinishingDefID
		  ,SortID
		  ,[Print]
		  ,PDF_Only
		  ,createDate
		  ,createUserID
		  ,OutputFilename
		  ,OldQueueName
		  ,ReportHPExstreamSymbolicName
		  ,m.ReportLayoutFileID
		  ,m.ReportIsArchive
		  ,ReturnReportInDJA
		  ,ReturnOutput
		  ,ShowOnShortReport
		  ,ShowPDFOnWebPortal
		  ,ShowReportOnWebPortal
		  ,IsCD
		  ,Colour
		  ,EncloseEnvelope
		  ,[Action]
		  ,IndexDefinitionName
		  ,ExstreamSymbolicIndexName
		  ,ExstreamSymbolicDataName
		  ,ExstreamSymbolicReportName
		  ,IndexDescription
		  ,i.ReportIsArchive
		  ,i.MailSortSettingID
	  FROM dbo.MediaDefinition m
	  INNER JOIN dbo.IndexDefinition i ON i.IndexDefinitionID = m.IndexDefinitionID
	  WHERE m.ManCoDocID = @ManCoDocID
END